package com.bw.day03

import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.launcher.ARouter
import com.bw.base.net.mvvm.BaseViewActivity
import com.bw.day03.databinding.ActivityWebViewBinding
import com.bw.day03.databinding.ActivityWelBinding
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

class WelActivity : BaseViewActivity<ActivityWelBinding>() {
    override fun initView() {
        lifecycleScope.launch {
            for (i in 5 downTo 1){
                binding.djs.text="$i 秒"
                delay(1000)
                if (i==1){
                    ARouter.getInstance().build("/app/ShopActivity").navigation()
                }
            }
        }
        binding.djs.setOnClickListener {
            finish()
            ARouter.getInstance().build("/app/ShopActivity").navigation()
        }
    }

    override fun initData() {

    }

    override fun getLayoutId(): Int = R.layout.activity_wel

}